package cn.jboa.dao.impl;

import cn.jboa.dao.ClaimVoucherDetailDao;
import cn.jboa.entity.BizClaimVoucher;
import cn.jboa.entity.BizClaimVoucherDetail;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

@Repository("claimVoucherDetailDao")
public class ClaimVoucherDetailDaoImpl extends BaseHibernateDaoSupport<BizClaimVoucherDetail> implements ClaimVoucherDetailDao {

    public ClaimVoucherDetailDaoImpl(){}
    @Autowired
    public ClaimVoucherDetailDaoImpl(@Qualifier("sessionFactory")SessionFactory sessionFactory){this.setSessionFactory(sessionFactory);}

    @Override
    public int deleteByClaimVoucher(BizClaimVoucher claimVoucher) {
        String hql="delete from BizClaimVoucherDetail where bizClaimVoucher.id=?";
        return this.getHibernateTemplate().bulkUpdate(hql,claimVoucher.getId());
    }
}
